package com.ibm.risk.irmp.common.audit;

import jakarta.persistence.Column;
import jakarta.persistence.EntityListeners;
import jakarta.persistence.MappedSuperclass;
import lombok.Data;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import java.io.Serializable;
import java.time.ZonedDateTime;

/**
 * @author WeiYZZhou
 */
@Data
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public class CreatOnlyAuditable implements Serializable {
    @CreatedDate
    @Column(updatable = false)
    private ZonedDateTime createdAt;
    @CreatedBy
    @Column(updatable = false)
    private String createdBy;
}
